package org.example.demo;
import org.springframework.web.bind.annotation.RequestMethod;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class UserController {
    @RequestMapping("/method")
    public String method(String text) {
        return "接收到参数："+text;
    }


    @RequestMapping(value = "/user",method = {RequestMethod.GET, RequestMethod.POST})
    //仅能支持GET请求方式
    public String user() {
        return "成功建立连接";
    }
}
